/**
 * 
 */
package systole.domain.persons.identityCard;

import java.io.Serializable;

/**
 * @author jmj
 *
 */
public class IdentityCard implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 919696630745549130L;
    private IdentityCardType cardType;
    private Integer number;

    /**
     *
     */
    public IdentityCard() {
       super();
    }

    /**
     * 
     * @param cardType
     * @param number
     */
    public IdentityCard(IdentityCardType cardType, Integer number) {
        this.cardType = cardType;
        this.number = number;
    }

    /**
     * @param cardType the cardType to set
     */
    public void setCardType(IdentityCardType cardType) {
        this.cardType = cardType;
    }

    /**
     * @return the cardType
     */
    public IdentityCardType getCardType() {
        return this.cardType;
    }

    /**
     * @param number the number to set
     */
    public void setNumber(Integer number) {
        this.number = number;
    }

    /**
     * @return the number
     */
    public Integer getNumber() {
        return this.number;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final IdentityCard other = (IdentityCard) obj;
        if (this.cardType != other.cardType && (this.cardType == null || !this.cardType.equals(other.cardType))) {
            return false;
        }
        if (this.number != other.number && (this.number == null || !this.number.equals(other.number))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 53 * hash + (this.cardType != null ? this.cardType.hashCode() : 0);
        hash = 53 * hash + (this.number != null ? this.number.hashCode() : 0);
        return hash;
    }
}
